package com.ethink.order.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ethink.order.api.info.SaleDetailOrderInfo;
import com.ethink.order.api.info.SaleOrderInfo;
import com.ethink.order.api.model.SaleOrderModeQueryModel;
import com.ethink.order.api.model.SaleOrderPageQueryModel;
import com.ethink.order.api.request.*;
import com.ethink.order.api.response.SaleOrderAddResponse;
import com.ethink.order.api.response.SaleOrderDetailResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * TOC销售单 Facade接口
 *
 * @author default
 * @date 2022-11-22
 */
@FeignClient(name = "ethink-order-service", path = "order-service/facade/v1/saleOrder", contextId = "saleOrderFacade")
public interface SaleOrderFacade {

    @PostMapping("/addSaleOrder")
    @ResponseBody
    SaleOrderAddResponse addSaleOrder(@RequestBody SaleOrderAddRequest request);


    @PostMapping("/pageQuerySaleOrder")
    @ResponseBody
    Page<SaleOrderPageQueryModel> pageQuerySaleOrder(@RequestBody SaleOrderQueryRequest request);

    @GetMapping("/deleteSaleOrder")
    @ResponseBody
    Integer deleteSaleOrder(@RequestParam("id") Long id);


    @GetMapping("/getSaleOrderById")
    @ResponseBody
    SaleOrderDetailResponse getSaleOrderById(@RequestParam("id") Long id);

    @GetMapping("/getSaleOrderByOrderNo")
    @ResponseBody
    SaleOrderDetailResponse getSaleOrderByOrderNo(@RequestParam("orderNo") String orderNo);

    @PostMapping("/updateSaleOrder")
    @ResponseBody
    Integer updateSaleOrder(@RequestBody SaleOrderUpdateRequest request);

    @PostMapping("/updateStatus")
    @ResponseBody
    Integer updateStatus(@RequestBody SaleOrderUpdateStatusRequest request);

    @PostMapping("/createFinish")
    @ResponseBody
    void createFinish(@RequestBody List<SaleOrderAdd2Request> add2RequestList);

    @GetMapping("/queryDetailListByOrderNo")
    @ResponseBody
    List<SaleDetailOrderInfo> queryDetailListByOrderNo(@RequestParam("orderNo") String orderNo);

    @PostMapping("/querySaleOrderDetailOrderNoByOrderNo")
    @ResponseBody
    List<String> querySaleOrderDetailOrderNoByOrderNo(@RequestBody List<String> orderNos);

    @PostMapping("/pageSaleOrderModeQuery")
    @ResponseBody
    Page<SaleOrderModeQueryModel> pageSaleOrderModeQuery(@RequestBody SaleOrderModeQueryRequest request);

    @GetMapping("/getSaleOrderByShopOrderNo")
    @ResponseBody
    SaleOrderDetailResponse getSaleOrderByShopOrderNo(@RequestParam("saleSubChannel") String saleSubChannel,@RequestParam("shopOrderNo") String shopOrderNo);

    @GetMapping("/selectSaleOrderById")
    @ResponseBody
    SaleOrderInfo selectSaleOrderById(@RequestParam("id") Integer id);

}